All Questions
11 questions
-1votes
1answer
181views
Best practices for creating structured data from "flat" SQL query results
Recently I've been working on a project to teach myself PHP and SQL, and as the project has gotten more complex I've been wondering what the idiomatic approaches are for creating the backend models ...
1vote
2answers
619views
clarification about DAL and MySQLi functions in PHP
Up to now, I was considering MySQLi functions in PHP one example of DAL. And I initiated a simple project to publish in an article with the title "starting with PHP and DAL and MySQL" But when I made ...
1vote
4answers
1kviews
How to deal with long running transactions?
I'm developing a Content Management System (CMS) and I would like to include a "Save Changes" button. I mean: a user performs several changes in the database, but those changes are still not available....
3votes
1answer
243views
How do SQL transactions return immediate results?
I am using transactions to do bulk insert/updates. This is my little test loop: $now = date('Y-m-d H:i:s'); for ($i=0; $i<60; $i++) { $db->insert($cfg['ps_manufacturer'], array( '...
0votes
1answer
244views
What is the problem will happen if I create auto generate ID without using mysql auto increase of mysql table by my self?
I would like to ask you a question about MySQL AUTO_INCREMENT. I already created my own function to generate AUTO_INCREMENT when the user inserts any data input a table in MySQL. This function works ...
-6votes
6answers
16kviews
How to not let anyone inspect elements of a webpage?
I was thinking to make some jQuery functions that will use ajax to control mysql. The whole idea is to make separate files of PHP (e.g query.php, addRow.php, update.php and delete.php) provide data to ...
0votes
2answers
3kviews
Large MySQL Batch Inserts From PHP: Run insert from script, or save as SQL file?
We have a large dataset that's current residing in many, many spreadsheets. I've been tasked with getting part of that data into our MySQL DB. When all is said and done, I will probably be inserting ...
1vote
1answer
1kviews
Store data for multiple User Type
I am developing an app where four types of user share same module. So is it a good idea to create: one table and user_type and user_id (something like that) table prefixes basically 4 diff tables of ...
4votes
6answers
2kviews
OOP (php) for beginners - some unclarities
I started reading some tutorials about OOP, because I want to learn the basics. I have a question about it. I understand how you can have a object "Car" and give it a color like this $oCar->setColor("...
2votes
2answers
215views
Better way to search for text in two columns
Here is the scenario. I am making a custom blogging software for my site. I am implementing a search feature. It's not very sophisticated - basically it just takes the search phrase entered and runs ...
4votes
3answers
1kviews
Why put SQL statement in a variable before using mysql_query()?
I'm been working with PHP on and off for a bit now, and I've seen plenty of code both ways: $sql = "SELECT …"; mysql_query($sql); vs mysql_query("SELECT…"); Is there a reason for separating the two,...